/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.antexpress.dao;

import com.antexpress.pojo.Bill;
import com.antexpress.pojo.BillSelector;
import com.antexpress.pojo.CustomerInfo;
import com.antexpress.pojo.Employee;
import com.antexpress.pojo.MapCity;
import com.antexpress.pojo.MapDistrict;
import com.antexpress.pojo.MapProvince;
import com.antexpress.pojo.MapTown;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 *
 * @author Dannis
 */
public interface BillDAO {

    List<Bill> getAllBill();//获取所有的订单  VIP人员获得的所有Bill信息

    boolean addSendBill(Bill newBill);//添加一个发货单

    List<Bill> getBillByStatus(int status);//获取不同类型的Bill List 用于不同人员的修改权限

    Bill getBillByID(String id);//通过订单号找到这个订单

    boolean updateBill(Bill newbill);//更新Bill

    boolean deleteBill(Bill bill);//删除各种状态的单，各种类型的单  单个删除

    boolean deleteBills(ArrayList<Bill> bills);//删除各种状态的单，各种类型的单          批量删除

    List<Bill> selectBill(BillSelector select);//根据多个条件进行查询，任意状态的订单都可以查

    List<MapProvince> getAllProvince();//用于页面显示省市曲线

    List<MapCity> getAllCityByProID(String proID);//用于页面显示省市曲线

    List<MapDistrict> getAllDistrictByCityId(String CityID);//用于页面显示省市曲线

    List<MapTown> getAllTownByDistrictID(String DistrictID);//用于页面显示省市曲线

    MapProvince getProvinceByID(String id);

    MapCity getCityByID(String id);

    MapDistrict getDistrictByID(String id);

    MapTown getTownByID(String id);

    void saveCustomerInfo(CustomerInfo consignorinfo);
    
    int getAllRowCount();
    
    List<Bill> listBillForPage(int offset, int length,int status);
    
    
    MapTown getEmployeeMapTown(Employee emp);
    
    //根据相应区域经理查询相应地区的订单
    List<Bill> listNormalBillForPage(int offset, int length,int status,List<CustomerInfo> consignorinfo);
    List<Bill> listNormalBillForPage(int offset, int length,int status,List<CustomerInfo> consignorinfo,Date createtimestart, Date createtimeend, Date updatetimestart, Date updatetimeend);
    List<CustomerInfo> getCustomerListInfoByMapTown(MapTown town);
    
    int getNumOfFinishedBill();
    int getNumOfNotFinishedBill();
//    boolean ChangeBillStatus(Bill bill); //生成别的单
//    boolean ChangeBillStatusToBusiness();//生成业务通知单
//    boolean ChangeBillStatusToNewWorkBill();//生成新单
//    boolean ChangeBillStatusToChangedWorkBill();//生成改单
//    boolean ChangeBillStatusToCancelWorkBill();//生成销单
//    boolean ChangeBillStatusToDelete();//生成删除单，保存于数据库
}
